/*
** hook.c for  in /home/guicqu_g//svn/rush-epikong/etape_2
** 
** Made by gallien guicquero
** Login   <guicqu_g@epitech.net>
** 
** Started on  Sun Mar 27 15:28:34 2011 gallien guicquero
** Last update Sun Mar 27 19:59:39 2011 gallien guicquero
*/

int	take_speed(int speed)
{
  if (speed < 0)
    return (0);
  if (speed == 0)
    return (1);
  if (speed == 1)
    return (2);
  return (speed * speed);
}

int	is_valid(int cols, int rows, int x, int y)
{
  if (x < 1 || x >= cols - 1 || y < 1 || y >= rows - 1)
    return (0);
  return (1);
}
